package com.yljk.yljkproject.modelcallback;

import android.content.Context;
import android.content.SharedPreferences;

import androidx.annotation.NonNull;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.yilijk.base.utils.SharedPreferencesUtils;
import com.yljk.mcbase.provider.SpService;
import com.yljk.mcconfig.constants.MCARouter;

/**
 * 使用主项目加密的sp
 *
 * @author cenjunlei
 * @date 2021/10/11 20:13
 */
@Route(path = MCARouter.SP_SERVICE)
public class SpServiceImpl implements SpService {
    @Override
    public void saveurl(String key, Object value) {
        SharedPreferencesUtils.getInstance().saveurl(key, value);
    }

    @Override
    public void save(String key, Object value) {
        SharedPreferencesUtils.getInstance().save(key, value);
    }

    @Override
    public void saveUment(String key, Object value) {
        SharedPreferencesUtils.getInstance().saveUment(key, value);
    }

    @Override
    public void savePop(String key, Object value) {
        SharedPreferencesUtils.getInstance().savePop(key, value);
    }

    @Override
    public void saveCommon(SharedPreferences mSp, String key, Object value) {
        SharedPreferencesUtils.getInstance().saveCommon(mSp, key, value);
    }

    @Override
    public String getPop_String(String key, String defValue) {
        return SharedPreferencesUtils.getInstance().getPop_String(key, defValue);
    }

    @Override
    public boolean getPop_Boolean(String key, boolean defValue) {
        return SharedPreferencesUtils.getInstance().getPop_Boolean(key, defValue);
    }

    @Override
    public int getPop_Integer(String key, int defValue) {
        return SharedPreferencesUtils.getInstance().getPop_Integer(key, defValue);
    }

    @Override
    public String geturl_String(String key, String defValue) {
        return SharedPreferencesUtils.getInstance().geturl_String(key, defValue);
    }

    @Override
    public String getUment_String(String key, String defValue) {
        return SharedPreferencesUtils.getInstance().getUment_String(key, defValue);
    }

    @Override
    public String getString(String key, String defValue) {
        return SharedPreferencesUtils.getInstance().getString(key, defValue);
    }

    @Override
    public boolean getBoolean(String key, boolean defValue) {
        return SharedPreferencesUtils.getInstance().getBoolean(key, defValue);
    }

    @Override
    public long getLong(String key, long defValue) {
        return SharedPreferencesUtils.getInstance().getLong(key, defValue);
    }

    @Override
    public String getAllData(SharedPreferences mSp, String key, String defValue) {
        return SharedPreferencesUtils.getInstance().getAllData(mSp, key, defValue);
    }

    @Override
    public boolean removeData(@NonNull String[] keys) {
        return SharedPreferencesUtils.getInstance().removeData(keys);
    }

    @Override
    public boolean removeAll(Context context) {
        return SharedPreferencesUtils.getInstance().removeAll(context);
    }

    @Override
    public boolean removePopAll(Context context) {
        return SharedPreferencesUtils.getInstance().removePopAll(context);
    }

    @Override
    public void init(Context context) {

    }
}
